package com.education.welco.service.impl;


import com.education.common.utils.Convert;
import com.education.welco.mapper.TClassMapper;
import com.education.welco.pojo.TClass;
import com.education.welco.service.ITClassService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

/**
 * 班级 服务层实现
 *
 * @author d
 * @date 2020-05-08
 */
@Service
public class TClassServiceImpl implements ITClassService {

    @Autowired
    private TClassMapper tClassMapper;

    /**
     * 查询班级信息
     *
     * @param list 班级ID 集合
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByIds(List<Integer> list) {
        return tClassMapper.selectTClassByIds(list);
    }

    /**
     * 查询班级信息
     *
     * @param id 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectLookTClassByClassId(Integer id) {
        return tClassMapper.selectLookTClassByClassId(id);
    }

    /**
     * 查询完结班级信息
     *
     * @param id 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectOverTClassByClassId(Integer id) {
        return tClassMapper.selectOverTClassByClassId(id);
    }

    /**
     * 查询班级信息 针对于分享班级
     *
     * @param id 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByClassIdAndLook(Integer id) {
        return tClassMapper.selectTClassByClassIdAndLook(id);
    }

    @Override
    public List<TClass> selectTClassByTeaId(Integer teacherId) {
        return tClassMapper.selectTClassByTeaId(teacherId);
    }

    /**
     * 查询没用被占用的教室列表
     *
     * @param map 教室信息
     * @return 教室集合
     */
    @Override
    public List<TClass> selectTClassListNotIn(HashMap<String, Object> map) {
        return tClassMapper.selectTClassListNotIn(map);
    }

    /**
     * 查询班级信息
     *
     * @param id 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByClassId(Integer id) {
        return tClassMapper.selectTClassByClassId(id);
    }

    /**
     * 查询班级信息
     *
     * @param catalogId 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByCatalogId(Integer catalogId) {
        return tClassMapper.selectTClassByCatalogId(catalogId);
    }


    /**
     * 查询班级信息
     *
     * @param resourceId 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByResourceId(Integer resourceId) {
        return tClassMapper.selectTClassByResourceId(resourceId);
    }

    /**
     * 查询预习 查看班级
     *
     * @param catalogId 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByCatalogIdPreviewAll(Integer catalogId) {
        return tClassMapper.selectTClassByCatalogIdPreviewAll(catalogId);
    }

    /**
     * 查询作业 查看班级
     *
     * @param catalogId 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByCatalogIdWorkAll(Integer catalogId) {
        return tClassMapper.selectTClassByCatalogIdWorkAll(catalogId);
    }

    /**
     * 查询试题 查看班级
     *
     * @param catalogId 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByCatalogIdQuestAll(Integer catalogId) {
        return tClassMapper.selectTClassByCatalogIdQuestAll(catalogId);
    }

    /**
     * 查询课程问答
     *
     * @param answeringId
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByCatalogIdAnswerAll(Integer answeringId) {
        return tClassMapper.selectTClassByCatalogIdAnswerAll(answeringId);
    }

    /**
     * 查询课程问答
     *
     * @param catalogId 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByCatalogIdAnswer(Integer outId, Integer catalogId) {
        return tClassMapper.selectTClassByCatalogIdAnswer(outId, catalogId );
    }

    @Override
    public List<TClass> selectTClassByCatalogIdVideo(Integer resourceId, Integer catalogId) {
        return tClassMapper.selectTClassByCatalogIdVideo(resourceId, catalogId);
    }

    @Override
    public List<TClass> selectTClassByCatalogIdVideoAll(Integer catalogId) {
        return tClassMapper.selectTClassByCatalogIdVideoAll(catalogId);
    }

    /**
     * 查询预习
     *
     * @param catalogId 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByCatalogIdPreview(Integer outId, Integer catalogId) {
        return tClassMapper.selectTClassByCatalogIdPreview(outId, catalogId );
    }

    /**
     * 查询课后作业
     *
     * @param catalogId 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByCatalogIdWork(Integer outId, Integer catalogId ) {
        return tClassMapper.selectTClassByCatalogIdWork(outId, catalogId  );
    }


    /**
     * 查询班级信息
     *
     * @param tClass 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByCatalogIdAndType(TClass tClass) {
        return tClassMapper.selectTClassByCatalogIdAndType(tClass);
    }

    /**
     * 查询试卷试题
     *
     * @param catalogId 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByCatalogIdQuest(Integer outId, Integer catalogId  ) {
        return tClassMapper.selectTClassByCatalogIdQuest(outId, catalogId );
    }

    /**
     * 查询班级信息
     *
     * @param tClass 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByCatalogId3(TClass tClass) {
        return tClassMapper.selectTClassByCatalogId3(tClass);
    }

    /**
     * 资源 查询班级信息
     *
     * @param catalogId 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByCatalogId2( Integer catalogId,Integer resourceId) {
        return tClassMapper.selectTClassByCatalogId2( catalogId,resourceId);
    }

    /**
     * 查询班级信息
     *
     * @param schoolId 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassAllBySchoolId(Integer schoolId) {
        return tClassMapper.selectTClassAllBySchoolId(schoolId);
    }

    @Override
    public List<TClass> selectTClassAllBySchoolId1(Integer schoolId) {
        return tClassMapper.selectTClassAllBySchoolId1(schoolId);
    }

    @Override
    public List<TClass> selectClassListByTeaId(TClass tClass) {
        return tClassMapper.selectClassListByTeaId(tClass);
    }

    /**
     * 查找某学校下的所有班级
     *
     * @param schoolId
     * @return
     */
    @Override
    public List<TClass> queryClassListAllForTea(Integer schoolId) {
        return tClassMapper.queryClassListAllForTea(schoolId);
    }

    /**
     * 查询班级信息
     *
     * @param deptId 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassAllByDeptId(Integer deptId) {
        return tClassMapper.selectTClassAllByDeptId(deptId);
    }

    /**
     * 查询班级信息
     *
     * @param deptId 班级ID
     * @return 班级信息
     */
    @Override
    public List<TClass> selectTClassByDeptId(Integer deptId,Integer catalogId, Integer userId) {
        return tClassMapper.selectTClassByDeptId(deptId,catalogId, userId);
    }

    /**
     * 查询班级信息
     *
     * @param id 班级ID
     * @return 班级信息
     */
    @Override
    public TClass selectTClassById(Integer id) {
        return tClassMapper.selectTClassById(id);
    }


    /**
     * 查询班级列表
     *
     * @param tClass 班级信息
     * @return 班级集合
     */
    @Override
    public List<TClass> selectTClassListOther(TClass tClass) {
        return tClassMapper.selectTClassListOther(tClass);
    }

    /**
     * 查询班级列表
     *
     * @param tClass 班级信息
     * @return 班级集合
     */
    @Override
    public List<TClass> selectTClassList(TClass tClass) {
        return tClassMapper.selectTClassList(tClass);
    }

    /**
     * 新增班级
     *
     * @param tClass 班级信息
     * @return 结果
     */
    @Override
    public int insertTClass(TClass tClass) {
        return tClassMapper.insertTClass(tClass);
    }

    /**
     * 修改班级
     *
     * @param tClass 班级信息
     * @return 结果
     */
    @Override
    public int updateTClass(TClass tClass) {
        return tClassMapper.updateTClass(tClass);
    }

    /**
     * 删除班级对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTClassByIds(String ids) {
        return tClassMapper.deleteTClassByIds(Convert.toStrArray(ids));
    }

    @Override
    public List<TClass> selectTClassAlluserId(Integer userId) {
        return tClassMapper.selectTClassAlluserId(userId);
    }
}